1. 注意命名的时候不要重复
  2. 注意边界条件
  3. 联系一下类的书写和继承

  4. vector 去除重复元素:

     vector<vector<int>> myvec;
    
     sort\(myvec.begin\(\),myvec.end\(\)\);
    
     myvec.erase\(unique\(myvec.begin\(\),myvec.end\(\)\),myvec.end\(\)\);
    
  5. static bool compare(const Interval& a, const Interval& b){

    return a.start < b.start;
    

    }

    sort(intervals.begin(),intervals.end(),compare);

  6. permutation

  1. power of n

https://leetcode.com/problems/power-of-three/discuss/77876/**-A-summary-of-all-solutions-(new-method-included-at-15:30pm-Jan-8th\)

results matching ""

    No results matching ""